package exception;

import structures.ServiceCallInfo;
import structures.log.LogThreadStarter;

public class IBServiceCallException extends IBException {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2594767674810838926L;

	public IBServiceCallException(ExceptionStringHandler exceptionStringHandler, ServiceCallInfo callInfo) {
		super(exceptionStringHandler);
		log(exceptionStringHandler, callInfo);
	}
	
	private void log(ExceptionStringHandler exceptionStringHandler, ServiceCallInfo callInfo){
		String errorType = exceptionStringHandler.getErrorId() == null ? null : exceptionStringHandler.getErrorId().toString();
		LogThreadStarter.logServiceCallError(callInfo, errorType, exceptionStringHandler.getMessage());
	}
}
